package com.hongdee.crm.coupon.dao.impl;

import com.hongdee.base.basedao.impl.BaseDaoImpl;
import com.hongdee.crm.coupon.dao.ITCrmCarCouponDao;
import com.hongdee.crm.coupon.entity.TCrmCarCoupon;
import com.hongdee.crm.coupon.entity.TInsuranceOrderCoupon;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * 名  称:TCrmCarCouponDaoImpl
 * 类  型:${TYPE}
 * 描  述:
 * 路  径:com.hongdee.crm.coupon.dao.impl
 * 作  者: 术洪超
 * 日  期:2017-02-28 11:04
 */

@Service
public class TCrmCarCouponDaoImpl extends BaseDaoImpl implements ITCrmCarCouponDao {

    @Override
    public TInsuranceOrderCoupon getInfo(String couponId) throws Exception {
        String sql="from TInsuranceOrderCoupon where id=:id";
        Map map=new HashMap();
        map.put("id",couponId);
        return (TInsuranceOrderCoupon) this.getHibernateDao().findEntityByHqlWithParams(sql,map);
    }

    @Override
    public TCrmCarCoupon info(String id) throws Exception {
        String sql="from TCrmCarCoupon where id=:id";
        Map map=new HashMap();
        map.put("id",id);
        return (TCrmCarCoupon) this.getHibernateDao().findEntityByHqlWithParams(sql,map);
    }
}
